package com.itany.shop.listener;

import javax.servlet.ServletRequestAttributeEvent;
import javax.servlet.ServletRequestAttributeListener;

/**
 * @author 石小俊
 * @date 2023年10月31日 9:06
 */
public class LogListener implements ServletRequestAttributeListener {
    @Override
    public void attributeAdded(ServletRequestAttributeEvent event) {
        System.out.println("向request中添加了一条数据,name:"+event.getName()+",value:"+event.getValue());
    }

    @Override
    public void attributeRemoved(ServletRequestAttributeEvent event) {
        System.out.println("删除了request中的一条数据,name:"+event.getName()+",value:"+event.getValue());
    }

    @Override
    public void attributeReplaced(ServletRequestAttributeEvent event) {
        System.out.println("替换了request中的一条数据,name:"+event.getName()+",value:"+event.getValue());
    }
}
